<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view/>
    </div>
  </a-config-provider>
</template>

<script>
import { domTitle, setDocumentTitle } from '@/utils/domUtil'
import { i18nRender } from '@/locales'
import moment from 'moment'
export default {
  data () {
    return {
    }
  },
  computed: {
    locale () {
      // 只是为了切换语言时，更新标题
      const { title } = this.$route.meta
      title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))

      return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
    }
  },
  mounted(){
    window.onresize = () => {
      return (() => {
        // console.log('尺寸发生了改变');
        this.$store.state.screenWidth = document.documentElement.clientWidth; //窗口宽度
        this.$store.state.screenHeight = document.documentElement.clientHeight; //窗口高度
      })()
    }
    // window.onload = (e)=>{
    //   this.$nextTick(()=>{
    //     this.$router.push({
    //       name: 'home',
    //       params: {
    //         iscloseMul:true,
    //       }
    //     })
    //   })
    // };
  }
}
</script>
